✨ BCA JUL24 Batch ✨

Join Our WhatsApp Group

Anukasif Pic

2.2 - C Statements - MCQs

Interactive MCQs Quiz

Test your knowledge with these questions

1. What is a variable in C?

2. Where should variables be declared in C?

3. Which of the following is a valid C variable declaration?

4. Which character must be used at the start of a variable name in C?

5. Which of the following is NOT a valid C data type?

6. What keyword is used to declare a static variable in C?

7. Which variable type in C is declared outside any function and can be used by any function?

8. What keyword is used to declare a variable that can be shared across multiple source files in C?

9. What are tokens in C programming?

10. What is the purpose of the initializer in a variable declaration in C?

11. Which of the following rules is NOT correct for naming variables in C?

12. What type of variable in C retains its value between function calls?

13. What is the correct way to declare a global variable in C?

14. In C programming, what does the term ‘bus’ refer to?

15. How many basic categories of software are there?

16. Which of the following is used to declare a constant in C?

17. Which of the following is a valid string constant in C?

18. What is the correct syntax to define a symbolic constant?

19. Which of the following is an invalid identifier in C?

20. How many characters can an identifier have in C?

21. Which of the following is NOT a valid keyword in C?

22. Which special symbol is used to represent the null character in a string?

23. Which special character is used for function declaration and calls in C?

24. What does the special symbol * denote in C?

25. Which of the following is used to access members of a structure?

26. Which of the following is the size of a char in C?

27. What is the range of an unsigned char in C?

28. What is the default value of a signed char in C?

29. In a 16-bit environment, what is the range of an int in C?

30. Which of the following takes 4 bytes of memory and can store only positive values?

31. What is the format specifier for a long long int in C?

32. Which of the following types in C does not take any space in memory?

33. How many bytes does a double data type occupy in C?

34. Which of the following is a derived data type in C?

35. What is the purpose of a pointer in C?

36. Which data type in C can store data of multiple different types?

37. Which derived data type in C allows sharing memory among its members?

38. Which of the following is a double-precision floating-point value in C?

39. What is the format specifier for a float value in C?

40. In C programming, which character set is used to represent characters?

41. How are characters represented in C code?

42. What does the following C code represent? char myChar = 'A';

43. What is the role of lexical analysis in programming languages?

44. Which of the following is NOT a lexical unit (token) in C?

45. In the C statement int sum = num1 + num2;, what is + considered as?

46. Which of the following correctly identifies the statement terminator in C?

47. In C programming, what does the term "token" refer to?

48. In C, which of the following is an example of a keyword?

49. In the following statement: int num1;, what is num1 classified as?

50. What is the purpose of the #define directive in C programs?

51. Where are preprocessor directives like #define and #include typically written in a C program?

52. What is another name for the #define directive?

53. How does the #define directive work in a C program?

54. What is the purpose of the #include directive in C programs?

55. What is another name for the #include directive?

56. What type of files does the #include directive insert into the C program?

57. Which of the following is a pre-defined function found in header files included using the #include directive?

58. What happens when the #include directive is used in a C program?

59. Which directive is used to declare constant values or named expressions in C programs?

60. Which directive is the reverse of #ifdef in conditional compilation?

61. What happens when the condition in a #if directive evaluates to a non-zero value?

62. Which directive allows us to control the filename and line number reported in compilation errors?

63. What is the purpose of the #error directive?

64. Which directive is used to specify an alternative block of statements if the condition in #if is false and another condition is also false?

65. In the directive #line 100 "myfile.c", what is the significance of 100?

66. What happens if the condition in a #elif directive evaluates to zero?

67. Which directive allows the execution of a block of statements if the macro is not defined?

68. What must follow every #ifdef or #ifndef directive?

69. What is required when using the #error directive?